<?php

namespace App\Http\Requests\Frontend\V10\Users;

use Illuminate\Foundation\Http\FormRequest;

class UserFaceStoreRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'face_id'=>'required',
            'status'=>'required|in:1,2',
            'confidence'=>'required',
            'reset'=>'nullable|integer',
            'hand_cert'=>'requiredIf:status,1',
        ];
    }

    public function messages()
    {
        return [
            'face_id.required'=>'缺少人脸识别认证信息id',
            'status.required'=>'缺少人脸识别认证结果',
            'verify_time.required'=>'缺少人脸识别认证时间',
            'verify_time.date'=>'人脸识别认证时间异常',
            'reset_loan_id.integer'=>'授信信息异常',
            'hand_cert.requiredIf'=>'身份信息照片不能为空',
        ];
    }
}
